<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Cart extends Model
{
    //购物车
    
    protected $table = 'yds_cart';

    protected $primaryKey = 'id';

    //关闭更新  'updated_at`, `created_at' 字段
    public $timestamps = false;

    //一对一关系(购物车对应的书包里的商品)
    public function hasOnebags()
    {
        return $this->hasOne('App\Models\Bags','id','bagsid');
    }

    //一对一关系(同城换书的用户对应的用户信息)
    public function hasoneUsersReg()
    {
        return $this->hasOne('App\Models\UsersReg','uid','userid');
    }

}
